<?php
session_start();
$user = isset($_SESSION["user"])?$_SESSION["user"]:null;
if(!$user){
    echo "未登录，请先<a href='test_7_login.html'>登录</a>.";
}else{     //等同于echo
?>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="content-type" content="text/html charset=utf-8"/>
        <title>Eighth page</title>
    </head>
    <body>
        <h3>新添文章</h3>
        <form action="test_7_article_add_do.php" method="post">
            <div>
                <label>标题</label>
                <input type="text" name="Title" id="Title"/>
            </div>
            <div>
                <label>内容</label>
                <br>
                <textarea name="Content" id="Content" cols="80" rows="20"></textarea>
            </div>
            <div>
                <label>作者</label>
                <span>
                    <?php echo $user["Username"]?>
                </span>
            </div>
            <div>
                <input type="submit" value="提交"/>

                <input type="reset" value="重写"/>
            </div>
        </form>
    </body>
</html>
<?php }?>